<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<meta http-equiv="keywords" content="" />
<meta http-equiv="description" content="" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<link rel="stylesheet" type="text/css" href="/css/reset.css" />
<link rel="stylesheet" type="text/css" href="/css/common.css" />
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<style type="text/css">
body{background:#CCC;}
</style>
</head>

<body>
  <form action="/common/upload.dhtml" method="post" enctype="multipart/form-data">
    <input type="hidden" name="returnUrl" value="common/upload" /> <input type="hidden" id="uploadFileName"
      name="uploadFileName" value="<c:out value="${uploadFileName }" />" /> <input type="hidden" name="newname"
      value="true" /> <input type="hidden" name="savePath" value="<c:out value="${savePath}" />" />
    <table>
      <tr>
        <td>是否缩放</td>
        <td><select id="compress" name="compress">
            <option value="true">压缩</option>
            <option value="false">不压缩</option>
        </select></td>
      </tr>
      <tr id="size01">
        <td>宽</td>
        <td><input type="text" name="width" value="400"/></td>
      </tr>
      <tr id="size02">
        <td>高</td>
        <td><input type="text" name="height" value="400"/></td>
      </tr>
      <tr>
        <td>文件</td>
        <td><input type="file" name="file" /></td>
      </tr>
      <tr>
        <td></td>
        <td><input type="submit" value="上传" /></td>
      </tr>
    </table>
  </form>
  <img id="imgShow" src="" />
  <script type="text/javascript">
			//alert($("#uploadImg",parent.document.body).size());
			$("img").css({
				"display" : "none",
				"visibility" : "hidden",
				"height" : "60px"
			});
			if ("" != $("#uploadFileName").val()) {
				//alert($("#uploadFileName").val());
				$("#uploadImg", parent.document.body).val(
						$("#uploadFileName").val());
				$("img").attr("src", $("#uploadFileName").val());
				$("img").css({
					"display" : "block",
					"visibility" : "visible"
				});
			}
			
			$("#compress").change(function(){
				if($(this).val()=="true"){
					$("#size01 td").css({
						"display":"table-cell",
						"visibility":"visible"
					});
					$("#size02 td").css({
						"display":"table-cell",
						"visibility":"visible"
					});
				}else{
					$("#size01 td").css({
						"display":"none",
						"visibility":"hidden"
					});
					$("#size02 td").css({
						"display":"none",
						"visibility":"hidden"
					});
				}
			});
		</script>
</body>
</html>